"use strict";

angular.module("app").directive("appPositionClass", [function(){
	return {
		restrict: "A",
		replace: true,
		templateUrl: "view/template/positionClass.html",
		scope:{
			com: "=",
		},
		link: function($scope){
			$scope.showPosList= function(index){

//				console.log($scope.com);
				$scope.positionList = $scope.com.positionClass[index].positionList;
//				console.log(index);
				$scope.isActive = index;
				
			};
			$scope.$watch("com", function(newVal){
				if(newVal){
					$scope.showPosList(0);
				}
			});


		},
	};
}]);
